using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Material;


namespace HengTong.ViewModel.SupplyChain.SysMaterialAttributeVms
{
    public partial class SysMaterialAttributeTemplateVm : BaseTemplateVM
    {
        [Display(Name = "属性名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysMaterialAttribute>(x => x.Name);
        [Display(Name = "是否关键属性")]
        public ExcelPropety IsKeyAttributeExcel = ExcelPropety.CreateProperty<SysMaterialAttribute>(x => x.IsKeyAttribute);
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysMaterialAttribute>(x => x.MaterialId);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysMaterialAttribute>(x => x.Remark);
        [Display(Name = "排序")]
        public ExcelPropety OrderExcel = ExcelPropety.CreateProperty<SysMaterialAttribute>(x => x.Order);

	    protected override void InitVM()
        {
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysMaterialAttributeImportVm : BaseImportVM<SysMaterialAttributeTemplateVm, SysMaterialAttribute>
    {

    }

}
